package com.iflytek.voicecloud.rtasr.model;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import java.time.LocalDateTime;
import java.util.UUID;

@Entity
@Table(name = "nswers")
public class Answers {

    @Id
    @Column(name = "answer_id", nullable = false, columnDefinition = "UUID")
    private UUID answerId;

    @Column(name = "question_id", nullable = false, columnDefinition = "UUID")
    private UUID questionId;

    @Column(name = "interview_id", nullable = false, columnDefinition = "UUID")
    private UUID interviewId;

    @Column(name = "transcript_text", columnDefinition = "TEXT")
    private String transcriptText;

    @Column(name = "start_time", nullable = false)
    private LocalDateTime startTime;

    @Column(name = "end_time", nullable = false)
    private LocalDateTime endTime;

    // Constructors
    public void Answer() {}

    public void Answer(UUID answerId, UUID questionId, UUID interviewId, String transcriptText, LocalDateTime startTime, LocalDateTime endTime) {
        this.answerId = answerId;
        this.questionId = questionId;
        this.interviewId = interviewId;
        this.transcriptText = transcriptText;
        this.startTime = startTime;
        this.endTime = endTime;
    }

    // Getters and Setters
    public UUID getAnswerId() {
        return answerId;
    }

    public void setAnswerId(UUID answerId) {
        this.answerId = answerId;
    }

    public UUID getQuestionId() {
        return questionId;
    }

    public void setQuestionId(UUID questionId) {
        this.questionId = questionId;
    }

    public UUID getInterviewId() {
        return interviewId;
    }

    public void setInterviewId(UUID interviewId) {
        this.interviewId = interviewId;
    }

    public String getTranscriptText() {
        return transcriptText;
    }

    public void setTranscriptText(String transcriptText) {
        this.transcriptText = transcriptText;
    }

    public LocalDateTime getStartTime() {
        return startTime;
    }

    public void setStartTime(LocalDateTime startTime) {
        this.startTime = startTime;
    }

    public LocalDateTime getEndTime() {
        return endTime;
    }

    public void setEndTime(LocalDateTime endTime) {
        this.endTime = endTime;
    }

    @Override
    public String toString() {
        return "Answer{" +
                "answerId=" + answerId +
                ", questionId=" + questionId +
                ", interviewId=" + interviewId +
                ", transcriptText='" + transcriptText + '\'' +
                ", startTime=" + startTime +
                ", endTime=" + endTime +
                '}';
    }
}
